<#include "/common/layout.html"> <@body>
<div class="content">
	<form role="form" class="form-horizontal" method="post" action="/mall/issue/doEdit" id="editIssueForm">
		<div class="box-body">
			<input type="hidden" value="${(mallIssue.issueId)}" name="issueId" />
			<div class="form-group">
				<label for="deptName" class="col-sm-2 control-label">问题标题</label>
				<div class="col-sm-10">
					<input type="text" id="question" name="question" value="${(mallIssue.question)}" class="form-control" placeholder="请输入标题" required>
				</div>
			</div>
			<div class="form-group">
				<label for="deptDesc" class="col-sm-2 control-label">问题答案</label>
				<div class="col-sm-10">
					<textarea class="form-control" id="answer" name="answer" rows="5" placeholder="请输入内容，最多300个字符 ..." required>${mallIssue.answer}</textarea>
				</div>
			</div>
		</div>
	</form>
</div>
</@body>
<script type="text/javascript">
	function submitHandler() {
		if ($("#editIssueForm").validate().form()) {
			var formData = $("#editIssueForm").serialize();
			var index = layer.load(3); // 换了种风格
			$.ajax({
				url : $("#editIssueForm").attr('action'),
				type : 'POST',
				dataType : "json",
				data : formData,
				beforeSend : function() {
					$.modal.loading("正在处理中，请稍后...");
					$.modal.disable();
				},
				success : function(data) {
					layer.close(index);
					if (data.code == 200) {
						if (data.msg) {
							parent.layer.msg(data.msg, {
								icon : 1
							});
						} else {
							parent.layer.msg('提交成功', {
								icon : 1
							});
						}
						parent.layer.closeAll('iframe'); // 关闭当前frame
						window.parent.data_oTable.draw(false);
					} else {
						layer.msg(data.msg, {
							icon : 2
						});
						$.modal.closeLoading();
						$.modal.enable();
					}
				}
			});
		}
	}
</script>